<!-- 文章主页 -->
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>焦点学苑</title>
    <link rel="stylesheet" href="/css/base.css">
    <link rel="stylesheet" href="/css/style.css">
    <link href="/css/style.css" rel="stylesheet" type="text/css" />
</head>
<script>
    function changeto (url) {
        window.location.href = url;
    }
</script>

<body>
    <div class="head-box">
        <div class="head wrap">
            <div class="logo fl"><a href=""><img src="/images/logo.png"></a></div>
            <div class="head-right fr">
                <div class="head-a fr">
                    <div class="head-a1 fl"><a href=""><img src="/images/tb-a.png"></a></div>
                    <div class="head-a1 fl"><a href=""><img src="/images/tb-b.png"></a></div>
                    <span th:unless="${not #strings.isEmpty(session.u?.getUid())}">
                        <div class="head-a3 login-click fl"><a href="#">登录</a></div>
                        <div class="head-a4 fl"><a href="/register.html" target="blank">注册</a></div>
                    </span>
                    <span th:if="${not #strings.isEmpty(session.u?.getUid())}">
                        <div class="head-a4 fl">
                            <select name="" id="" class="head-a3" onchange="changeto($(this).val())">
                                <option value="" checked>我的</option>
                                <option value="/article-add.html"><a href="/blog/user/add.to"> 发表文章</a></option>
                                <option value="/ainArticleList"><a>我的作品</a></option>
                                <option value="/userConcernList"><a>我的收藏</a></option>
                                <option value="/logout"><a>注销</a></option>
                            </select>
                        </div>
                    </span>
                </div>
                <div class="clearfix"></div>
                <div class="nav fr">
                    <ul>
                        <li class="nav-cut"><a href="/">首页</a></li>
                        <li><a href="/blog/user/article.to">文章</a>
                            <!-- <div class="sub-nav">
                                    <div class="bich-top"></div>
                                    <div class="bich">
                                        <a href="">服饰</a>
                                        <a href="">美食</a>
                                        <a href="">出行</a>
                                        <a href="">约会</a>
                                    </div>
    
                                </div> -->
                        </li>
                        <li><a href="/course/courseList">课程</a></li>
                        <li><a href="#">活动</a></li>
                        <li><a href="#">联系我们</a></li>

                    </ul>
                </div>
                <div class="clearfix"></div>
            </div>
        </div>
    </div>
    <div class="content">
        <div class="wrap">
            <div class="art-height"></div>
            <div class="art-box">
                <div class="art-b">
                    <a th:each="hottestArticle:${hottestArticle}"
                        th:href="@{'/blog/user/comment?aid='+${hottestArticle.getAid()}}">
                        <div class="art-b1 fl">
                            <img th:src="@{|/img/${hottestArticle.getArtimg()}|}"
                                th:onclick="selectArticle(${hottestArticle.getAid()})">
                            <div class="art-inside"> [[${hottestArticle.title}]]</div>
                        </div>
                    </a>
                </div>
                <div class="art-c">
                    <div class="art-fl fl">
                        <div class="ru-title art-title">
                            <div class="cou-b1"><img src="/images/cou-b1.jpg">焦点文章</div>

                            <div class="ru-a1">
                                <div class="sort">排序</div>
                            </div>
                            <div class="ru-a2">
                                <div class="dropdown">
                                    <span>全部</span>
                                    <ul data-value="" class="droplist">
                                        <li th:each="type :${type}" th:data-id="${type.cid}">[[${type.typename}]]</li>
                                    </ul>
                                </div>
                            </div>
                        </div>
                        <div class="tjk">
                            <ul class="art-ul" id="art-null">
                                <a href="">
                                    <li>
                                        <div class="art-list">
                                            <div class="art-d fl"><img src="/upload/col-a.jpg"></div>
                                            <div class="art-e fl">
                                                <div class="col-b1">教你如何一步步把妹子泡到手</div>
                                                <div class="col-b2">焦点学苑<span>2015-11-02</span></div>
                                                <div class="col-b3">爱情的残酷之处在于，并不是你做了什么帮助你获得了女孩的欢心。</div>
                                            </div>
                                            <div class="art-f">
                                                <span><img src="/images/col-c1.jpg">0</span>
                                                <span><img src="/images/col-c2.jpg">3</span>
                                                <em><img src="/images/col-c3.jpg"></em>
                                                <em><img src="/images/col-c4.jpg"></em>
                                                <em><img src="/images/col-c5.jpg"></em>
                                            </div>
                                        </div>
                                        <div class="art-g"></div>
                                    </li>
                                </a>

                            </ul>
                        </div>

                        <div class="page m-48">
                            <a onclick="pageTo($(this).next().val())"><input type="hidden" id="prePage">《</input></a>
                            <span id="nav">1</span>
                            <a onclick="pageTo($(this).next().val())"><input type="hidden" id="nextPage">》</input></a>
                        </div>
                    </div>

                    <div class="art-fr fr">
                        <div class="post-y art-gg">
                            <div class="post-y1"><img src="/images/cou-b1.jpg">最新文章</div>
                            <ul>
                                <a th:each="article:${newArticle}"
                                    th:href="@{'/blog/user/comment?aid='+${article.getAid()}}">
                                    <li>
                                        <div class="post-y2"><img th:src="@{|/img/${article.getArtimg()}|}"></div>
                                        <div class="post-y3">[[${article.title}]]</div>
                                    </li>
                                </a>
                            </ul>
                        </div>

                    </div>
                </div>
                <!--art-c-->

            </div>
        </div>
    </div>

    <div class="footer">
        <div class="wrap">
            <div class="foot">
                <div class="foot-left fl">
                    <a href="">关于我们</a>
                    <a href="">加入我们</a>
                    <a href="contact.html">联系我们</a>
                    <a href="">媒体采访</a>
                </div>
                <div class="foot-c fl"><a href=""><img src="images/foot-logo.jpg"></a></div>
                <div class="foot-right fr">
                    <a href="">同城活动</a>
                    <a href="">课程资讯</a>
                    <a href="">最新发布</a>
                    <a href="">热门文章</a>
                </div>
            </div>
            <div class="foot-btm">网页制作by云邦</div>
        </div>
    </div>


    <!--登录注册弹窗-->
    <div class="mask"></div>
    <div class="login">
        <div class="login-title">
            <div class="login-a">登录</div>
            <div class="login-b"></div>
            <div class="login-c close">x</div>
        </div>
        <div class="login-btm">
            <div class="login-d"><input type="text" class="login-text" placeholder="注册时填写的邮箱"></div>
            <div class="login-d"><input type="password" class="login-pas" placeholder="密码"></div>
            <div class="login-d"><input type="button" class="login-btn" placeholder="登录"></div>
            <div class="login-f">
                <a href="">忘记密码</a>
                <span>还没有焦点账号?><a href="javascript:;" class="reg-href">点击注册</a></span>
            </div>
        </div>
    </div>

    <div class="reg">
        <div class="login-title">
            <div class="login-a">注册</div>
            <div class="login-b"></div>
            <div class="login-c close">x</div>
        </div>
        <div class="login-btm">
            <div class="login-d"><input type="text" class="login-text" placeholder="邮箱/手机号"></div>
            <div class="login-d"><input type="password" class="login-pas" placeholder="密码"></div>
            <div class="login-d"><input type="button" class="login-btn" placeholder="注册"></div>
            <div class="login-f">
                <a href="">忘记密码</a>
            </div>
        </div>
    </div>


    <script src="/js/jquery-1.11.1.min.js"></script>
    <script src="/js/Action.js"></script>
    <script>
        $(".sort").click(function () {
            $(this).toggleClass("sort-cut")
        })
    </script>
    <script>
        $(".dropdown").bind({
            click: function () {
                $(this).find(".droplist").stop().slideDown();
            },
            mouseleave: function () {
                $(this).find(".droplist").hide();
            }
        });
        function pageTo (pageNum) {
            $.getJSON("/blog/user/article.do?typeId=" + $(".dropdown .droplist").attr("data-value") + "&pageNum=" + pageNum, function (data) {
                var str = "";
                $.each(data.pages.list, function (i, items) {
                    str += "<a href='/blog/user/comment?aid=" + items.aid + "'><li><div class=\"art-list\">\n" +
                        "                                                          <div class=\"art-d fl\"><img src=\"/img/" + items.artimg + "\"  onclick='selectArticle(" + items.aid + ")'  ></div>\n" +
                        "                                                          <div class=\"art-e fl\">\n" +
                        "                                                                <div class=\"col-b1\">" + items.title + "</div>\n" +
                        "                                                                <div class=\"col-b2\">" + items.blogusers.uname + "<span>2015-11-02</span></div>\n" +
                        "                                                                <div class=\"col-b3\">" + items.content + "</div>\n" +
                        "                                                          </div>\n" +
                        "                                                          <div class=\"art-f\">\n" +
                        "                                                                <span><img src=\"/images/col-c1.jpg\">" + items.commentnum + "</span>\n" +
                        "                                                                <span><img src=\"/images/col-c2.jpg\">" + items.collnum + "</span>\n" +
                        "                                                                <em><img src=\"/images/col-c3.jpg\"></em>\n" +
                        "                                                                <em><img src=\"/images/col-c4.jpg\"></em>\n" +
                        "                                                                <em><img src=\"/images/col-c5.jpg\"></em>\n" +
                        "                                                          </div>\n" +
                        "                                                 </div>\n" +
                        "                                                 <div class=\"art-g\"></div>\n" +
                        "                                          </li></a>"
                });

                $("#art-null").html(str);

                $("#total").html(data.pages.total);
                if (data.pages.isFirstPage) {
                    $("#prePage").val(1)
                } else {
                    $("#prePage").val(data.pages.prePage)
                }
                $("#pageNum").html(data.pages.pageNum)
                var nav = ""
                $.each(data.pages.navigatepageNums, function (i, items) {
                    if (items == data.pages.pageNum) {
                        nav += "<a  href='javascript:;'  style='background-color: #1f7cb6'  onclick='pageTo(" + items + ")' >" + items + "</a>"
                    } else {
                        nav += "<a  href='javascript:;'  onclick='pageTo(" + items + ")' >" + items + "</a>"
                    }
                })
                $("#nav").html(nav);
                if (data.pages.isLastPage) {
                    $("#nextPage").val(data.pages.pageNum)
                } else {
                    $("#nextPage").val(data.pages.nextPage)
                }
            })
        }

        $(".dropdown .droplist li").click(function () {
            $(this).parents(".dropdown").children("span").text($(this).text());
            $(this).parents(".droplist").hide().attr("data-value", $(this).attr("data-id"));
            pageTo("")
        });
        function selectArticle (aid) {
            window.location.href = "/blog/user/comment?aid=" + aid;
        }

        pageTo("")

    </script>

</body>

</html>